<script type="text/javascript" language="javascript">
    (function($) {
        /*whatever jQuery stuff*/
        $(function(){
			//DateTime Picker
			$('.datetime').datetimepicker({
				dateFormat:'dd/mm/yy',
				timeFormat:'hh:mm',
				separator:' ',
				changeMonth : true,
				changeYear : true,
				yearRange: 'c+nn:+1',
				maxDate: '-1d',
				showHour: true,		
				showMinute: true,
				showTime: true		
			});	
        });
    })(jQuery);	
</script>
<div class="wrap">
 	<div id="icon-index" class="icon32"><br /></div><h2><?php echo ucwords(str_replace('_',' ',$this->uri->segment(1)));?> &raquo; <?php echo ucwords(str_replace('_',' ',$this->uri->segment(2)));?></h2>
</div>
<div id="wpbody-content">
    <div class="metabox-holder" id="dashboard-widgets">
            <div class="inside">
				<div id="filter_panel">
					<form action="<?php echo current_url();?>" method="get" name="SearchForm" id="SearchForm">
					<ul>
						<li>
							<span><?php echo lang('playlist_activity_start');?> :</span>
							<input type="text" name="playlist_activity_start" id="playlist_activity_start" value="<?php echo $dataPlaylistActivityStart;?>" class="datetime"/>
						</li>											
						<li>
							<span><?php echo lang('playlist_activity_end');?> :</span>
							<input type="text" name="playlist_activity_end" id="playlist_activity_end" value="<?php echo $dataPlaylistActivityEnd;?>" class="datetime"/>
						</li>	
						<li>
							<span><?php echo lang('playlist_reset_vote');?> :</span>
							<select id="playlist_reset_vote" name="playlist_reset_vote">
								<option value="1" selected="selected"><?php echo lang('yes');?></option>
								<option value="0"><?php echo lang('no');?></option>
							</select>
						</li>										
					</ul>
					<br />
					&nbsp;&nbsp;<input type="submit" value="<?php echo lang('button_update');?>" class="button-primary"/>
					<input type="reset" value="<?php echo lang('button_reset');?>" class="button-primary"/>
					</form>
				</div>
				<div class="tablenav top">
					<p class="search-box">
						<input type="button" onclick="javascript:toggleFilter(this);" class="button-primary" value="<?php echo lang('button_settings');?>" />
					</p>
				</div>		
				<form action="<?php echo current_url();?>/delete" method="post" name="ListForm" id="ListForm">
				<table cellspacing="0" class="wp-list-table widefat fixed">
					<thead>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => lang('playlist_id'),
									'orderby' => 'playlist_id',
									'width' => 60
								),
								array(
									'name' => lang('playlist_member_id'),
									'orderby' => 'member_id',
									'width' => 100
								),								
								array(
									'name' => lang('playlist_fb_id'),
									'orderby' => 'fb_id',
									'width' => 150
								),
								array(
									'name' => lang('playlist_name')
								),
								array(
									'name' => lang('playlist_vote_activity')
								)
							));
						?>
					</tr>
					</thead>
				
					<tfoot>
					<tr>
						<?php 
							echo generate_th_orderby(array(
								array(
									'name' => lang('playlist_id'),
									'orderby' => 'playlist_id',
									'width' => 60
								),
								array(
									'name' => lang('playlist_member_id'),
									'orderby' => 'member_id',
									'width' => 100
								),								
								array(
									'name' => lang('playlist_fb_id'),
									'orderby' => 'fb_id',
									'width' => 150
								),
								array(
									'name' => lang('playlist_name')
								),
								array(
									'name' => lang('playlist_vote_activity')
								)
							));
						?>																			
					</tr>
					</tfoot>
				
					<tbody>
						<?php
						if(!empty($dataResult)):
							foreach($dataResult as $key => $value):
						?>
							<tr>
								<td class=""><?php echo sprintf('%06d',$value->playlist_id);?></td>
								<td class=""><?php echo sprintf('%06d',$value->member_id);?></td>
								<td class=""><?php echo $value->fb_id;?></td>
								<td class=""><?php echo $value->playlist_name;?></td>
								<td class=""><?php echo $value->vote_activity;?></td>							
							</tr>
							<?php
							endforeach;
						else: //not exists
							?>
							<tr valign="middle" class="alternate"><td colspan="5"><?php echo lang('no_data');?></td></tr>			
						<?php
						endif;
						?>
					</tbody>
				</table>
				<div class="tablenav bottom">
					<div class="pager"><?php echo $pager;?></div>
				</div>
				</form>
            </div><!-- wpbody inside -->
    </div><!-- wpcontent -->
</div><!-- wpbody-content -->